/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Thing;

import Core.Vector2;
import javax.microedition.lcdui.game.Sprite;

/**
 *
 * @author THINH
 */
public class Flying extends Thing{
    //field
    protected int power = 0;
    protected int attack;
    //constructor
    public Flying(){
        super();
    }
    public Flying(String pathImage, int frameWidth, int frameHeight, int[]frameSequence){        
        super(pathImage, frameWidth, frameHeight, frameSequence);
    }
    //main func
    public void update(){
        //code here
        
        super.update();        
    }
    public void shoot(Vector2 direction){
        vel.add(direction);
        if(vel.x<0){
            int x = getX();
            int y = getY();
            sprite.setTransform(Sprite.TRANS_MIRROR);
            setPos(x,y);
        }
        if(vel.x>0){
            int x = getX();
            int y = getY();
            sprite.setTransform(Sprite.TRANS_NONE);
            setPos(x,y);
        }
        power = (int)direction.y;
    }
    
    public void setTransForm(int type)
    {
        this.sprite.setTransform(type);
    }
    
    public int getDamage()
    {
        return attack;
    }
}
